<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>会员管理</title>
<link href="__PUBLIC__/style.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/js/jquery.js" type="text/javascript"></script>
<script src="__PUBLIC__/artDialog/jquery.artDialog.js?skin=default" type="text/javascript"></script>
<script src="__PUBLIC__/artDialog/plugins/iframeTools.js" type="text/javascript"></script>
{if $close}
<script type="text/javascript">
    var win = art.dialog.open.origin;//来源页面
    win.location.reload();
    art.dialog.close();
</script>
{/if}
<script type="text/javascript">
    function fleshVerify(){
        var timenow = new Date().getTime();
        document.getElementById('verifyImg').src= '__URL__/verify.html?'+timenow;
    }
</script>
</head>
<body>
<form id="login-form" action="__URL__/getpassword" method="post">
    <input type="hidden" name="action" value="post" />
    <table width="100%" class="table_form">
        <tr><th width="60">注意:</th><td><span class="hot">1、暂不支持手机短信找回。<br />2、通过电子邮件Email发送新密码。<br />3、如果你没有填写信箱,请电话联系我们重置密码</span></td></tr>
        <tr><th>用户名</th><td><input type="text" name="loginuser" class=":required input-text" size="30" value="" /> 用户名、信箱或手机号</td></tr>
        <tr><th>验证码</th><td><input type="text" name="checkcode" class=":required input-text" size="5" /> <img src="__URL__/verify" border="0" align="absmiddle" height="20" width="50" style="margin-left:3px;" alt="如果您无法识别验证码，请点图片更换" onclick="fleshVerify()" id="verifyImg"/></td></tr>
    </table>
</form>
</body>
</html>
<script type="text/javascript">
    $(function () {
        var parent = art.dialog.parent,	// 父页面window对象
        api = art.dialog.open.api,//art.dialog.open扩展方法
        $ = function (id) {return document.getElementById(id)},
        form       = $('login-form'),
        loginuser = $('loginuser'),
        checkcode = $('checkcode')
        if (!api) return;
        api.title('找回密码')// 操作对话框
        .button({ // 自定义按钮
            name: '提交',
            callback: function () {
                if (check(loginuser)&&check(checkcode)) form.submit();
                return false;
            },focus: true
        },{name: '取消'});
        // 表单验证
        var check = function (input) {
            if (input.value === '') {
                inputError(input);
                input.focus();
                return false;
            } else {
                return true;
            };
        };
        // 输入错误提示
        var inputError = function (input){
            clearTimeout(inputError.timer);
            var num = 0;
            var fn = function () {
                inputError.timer = setTimeout(function () {
                    input.className = input.className === '' ? 'login-form-error' : '';
                    if (num === 5) {
                        input.className === '';
                    } else {
                        fn(num ++);
                    };
                }, 150);
            };
            fn();
        };
        window.onload = function () {setTimeout(function () {username.focus()}, 240);};
    })();
</script>